	<?php
	$show='';
	$tg=time();
	$tgout=50;
	$tgnew=$tg - $tgout;
	
	$conn=mysql_connect("localhost","root","") or die("can't connect");
	mysql_select_db("bee20564_chon",$conn);
	
	$sql_de="delete from useronline where tgtmp < $tgnew";
	$query_de=mysql_query($sql_de);
	
	//$result=mysql_query("SELECT ip FROM useronline WHERE date='".date("Y-m-d")."'");
	$result1=mysql_query("SELECT ip FROM useronline WHERE tgtmp > ".$tgnew."");
	$result2=mysql_query("SELECT DISTINCT ip FROM useronline WHERE local='".$_SERVER['PHP_SELF']."'");
	$result = mysql_query("SELECT sum(number) as tongso FROM visistor");
	$number = 0;
			while($k=mysql_fetch_array($result)){
				$number = $k['tongso'];
			}	
	$numbers = 0;
	$results = mysql_query("SELECT number FROM visistor WHERE dateadd='".date("Y-m-d")."'");
			while($m=mysql_fetch_array($results)){
				$numbers = $m['number'];
			}				
	$user1 = mysql_num_rows($result1);
	$user2 = mysql_num_rows($result2);
	print '<div> 
			<img src="'.PATH_HTTP.'image/today.png" width="16" height="16" alt="" /> 
			&nbsp;Đang online:&nbsp;'.$user2.'&nbsp;	</div> 
	 	<div> 
			<img src="'.PATH_HTTP.'image/all.png" width="16" height="16" alt="" /> 
			&nbsp;Lượt xem hôm nay:&nbsp;'.$numbers.'</div> <div>
			<img src="'.PATH_HTTP.'image/all.png" width="16" height="16" alt="" /> 
			&nbsp;Tổng lượt truy cập:&nbsp;'.$number.'</div> 			';
		
	?>
	